package Offer;

/**
 * 旋转数组的最小数字
 *
 * @author 是阿秋啊
 * @date 2022/04/03 21:56
 **/
public class Num11 {
    public int minArray(int[] numbers) {
        int i = 0;
        int j = numbers.length - 1;
        while (i < j) {
            int mid = i + (j - i) / 2;
            if (numbers[mid] < numbers[j]) {
                j = mid;
            } else if (numbers[mid] > numbers[j]) {
                i = mid + 1;
            } else {
                j--;
            }
        }
        return numbers[i];
    }
}
